#ifndef BOOK_H
#define BOOK_H

#include <string>
#include <list>

using namespace std;

typedef string Name;
typedef string Author;
typedef string ISBN;

class Borrower_t;

class Book_t{

	friend class Library_t; 

public:
	Book_t(Name name,Author author,ISBN isbn,unsigned int);
	~Book_t();
	bool isAvailable() const;
	unsigned int getNofAvailableCopies() const;
	unsigned int getNofCopies() const;
	bool setNofCopies(unsigned int );
	ISBN getISBN() const;
	const Name& getName() const;
	const Author& getAuthor() const;
	
	bool borrowBook(Borrower_t*);
	Borrower_t* returnBook(Borrower_t*);
protected:
	unsigned int num_copies;
	/* We use a list of pointer to a borrower that contains a person who borrowed or waits to borrow a book
	 * For each instance of a Borrower_t there is a unique ID associated with one pointer to it.
	 * Hence, it is sufficient to compare pointer values to find a borrower
	 */
	list<Borrower_t*>* list_of_borrowers;
	list<Borrower_t*>* list_of_waiting;
private:
	const Name name;
	const Author author;
	const ISBN isbn;
	Book_t();
	Book_t& operator=(const Book_t& rhs );
	Book_t( const Book_t& other );
};


#endif